<?php
/**
 * This file is display for Contact Page.
 */
get_header();
?>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=6T3p1p8tHCtcvxYPG0HgfIWdcfHyqdcU"></script>
<main class="main_content">
    <?php get_template_part('parts/content/page','banner');?>
	<section class="contact-form py-md-5 py-3">
        <div class="container px-md-0 py-md-5 py-3">
            <div class="row">
                <div class="col-md-8 pr-md-5">
			        <?php echo do_shortcode('[wpforms id="55"]')?>
                </div>
                <div class="col-md-4 contact-address pt-5 pt-md-0">
                    <p class="mb-3">电话:</p>
                    <h5 class="font-weight-normal pb-4 border-bottom mb-5">180700146968</h5>
                    <p class="mb-3">邮箱:</p>
                    <h5 class="font-weight-normal pb-4 border-bottom mb-5">490237797@qq.com</h5>
                    <p class="mb-3">地址:</p>
                    <h5 class="font-weight-normal pb-4 border-bottom mb-md-5 mb-3">浙江杭州滨江区风情大道江南国际城</h5>
                </div>
            </div>
        </div>
	</section>
	<section class="py-5 contact-map">
		<div class="container px-md-0 pb-5">
            <!--百度地图容器-->
            <div style="width:100%; min-height:450px;font-size:12px" id="map"></div>

            <script type="text/javascript">
                //创建和初始化地图函数：
                function initMap(){
                    createMap();//创建地图
                    setMapEvent();//设置地图事件
                    addMapControl();//向地图添加控件
                    addMapOverlay();//向地图添加覆盖物
                }
                function createMap(){
                    map = new BMap.Map("map");
                    map.centerAndZoom(new BMap.Point(120.243474,30.194448),15);
                }
                function setMapEvent(){
                    map.enableScrollWheelZoom();
                    map.enableKeyboard();
                    map.enableDragging();
                    map.enableDoubleClickZoom()
                }
                function addClickHandler(target,window){
                    target.addEventListener("click",function(){
                        target.openInfoWindow(window);
                    });
                }
                function addMapOverlay(){
                    var markers = [
                        {content:"",title:"江南国际城",imageOffset: {width:0,height:3},position:{lat:30.195837,lng:120.245109}}
                    ];
                    for(var index = 0; index < markers.length; index++ ){
                        var point = new BMap.Point(markers[index].position.lng,markers[index].position.lat);
                        var marker = new BMap.Marker(point,{icon:new BMap.Icon("http://api.map.baidu.com/lbsapi/createmap/images/icon.png",new BMap.Size(20,25),{
                                imageOffset: new BMap.Size(markers[index].imageOffset.width,markers[index].imageOffset.height)
                            })});
                        var label = new BMap.Label(markers[index].title,{offset: new BMap.Size(25,5)});
                        var opts = {
                            width: 200,
                            title: markers[index].title,
                            enableMessage: false
                        };
                        var infoWindow = new BMap.InfoWindow(markers[index].content,opts);
                        marker.setLabel(label);
                        addClickHandler(marker,infoWindow);
                        map.addOverlay(marker);
                    };
                }
                //向地图添加控件
                function addMapControl(){
                    var scaleControl = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});
                    scaleControl.setUnit(BMAP_UNIT_IMPERIAL);
                    map.addControl(scaleControl);
                    var navControl = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});
                    map.addControl(navControl);
                    var overviewControl = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:true});
                    map.addControl(overviewControl);
                }
                var map;
                initMap();
            </script>
        </div>
	</section>
</main>
<?php
get_footer();